package edu.java.homework.hw09.exercises.salads.products;

public enum EggProduct {
    BOILED_EGG(5), MAYONNAISE(10);

    // --- Instance Variable
    // ----------------------------------------------------
    private int price = 0;

    // --- Constructors
    // ---------------------------------------------------------
    private EggProduct() {
	this(0);
    }

    private EggProduct(int price) {
	this.price = price;

	// WRONG PRACTICE --> NOT RECOMMEND to call other methods in the
	// constructors
	// setPrice(price);
    }

    // --- Methods -------------------------------------------------------------

    public int getPrice() {
	return price;
    }

    // Usually this is not good to be done, because the enum is supposed to keep
    // information, which is not going to be changed in the time
    // public void setPrice(int price) {
    // // check input parameters
    // if (price < 0) {
    // throw new IllegalArgumentException(
    // "Incorrect input. The price would be 0 or positive integer number");
    // }
    // this.price = price;
    // }

    @Override
    public String toString() {
	return this.name().toLowerCase();
    }

}
